package org.john.apachetest;

import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;
import sun.misc.BASE64Encoder;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

/**
 * Created by adsame on 17-3-31.
 */
public class HttpGetTest {

    public static void main(String args[]) {
        String url = "http://192.168.32.190:度51-4/c=1,1,2&bidid=c8fb1205539cc96866a5a2baf8eb4c4c&ep=z+FzFYl2CL4pAQYHHLZatA==&adx=letv&url=http://www.btime.com/?src=hao_34q4e36pidl8lk8l1q3la0h41gh&from=haoz1t1p1&app=&deviceid=&userid=&ip=";
        try {
            System.out.println(URLEncoder.encode(url, "GBK"));
            System.out.println(URLEncoder.encode(url, "gbk"));
            System.out.println(URLEncoder.encode(url, "utf-8"));
            System.out.println(URLEncoder.encode(url, "UTF-8"));
            System.out.println(new BASE64Encoder().encode(url.getBytes()));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        HttpUriRequest request = new HttpGet(url);
    }
}
